import Vue from 'vue'

var imageHash = Vue.filter('imageHash', function (value) {
    var newSrc = 'https://fuss10.elemecdn.com/'
    //强制转化类型
    value = String(value)
    //获取截至类型 png jpg jpeg
    var type = value.substr(-3)

    newSrc += value.substr(0, 1) + '/'
    newSrc += value.substr(1,2) + '/'
    newSrc += value.substr(3) +'.'

    if(type == 'peg'){
        type = 'jpeg'
    }
    newSrc += type

    newSrc += '?imageMogr/format/webp/thumbnail/!90x90/'
    return newSrc
})
export default imageHash